<h1><span class="nproduct_ico"></span><?= lang('label_add_new_product') ?></h1>

<ul class="breadcrumb">
    <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
    <li><a href="javascript:void(0)"><?= lang('label_products'); ?></a></li>
    <li><?= lang('label_add_new_product') ?></li>
</ul>


<div class="page">
    <form class="forms4 fnproduct" action="<?php echo current_url() ?>" method="post" enctype="multipart/form-data">
        <br />
        <div class="select">
            <label><?= lang('label_main_cat') ?> :</label>
            <samp>
                <select name="maincat" id="prodmaincat">
                    <option value="0" <?php if (form_val('maincat') == '0') echo 'selected' ?> ><?= lang('label_select_maincat') ?></option>
                    <?php
                    if ($maincats) {
                        foreach ($maincats as $mcat) {
                            ?>
                            <option value="<?= $mcat->id ?>" <?php if (form_val('maincat') == $mcat->id) echo 'selected' ?>><?php $mtitle = unserialize($mcat->title); echo (isset($mtitle[LANG])) ? $mtitle[LANG] : ((LANG == 'ar') ? $mtitle['en'] : $mtitle['ar']); ?></option>
                            <?php
                        }
                    }
                    ?>
                </select>
            </samp>
        </div>
        <div class="select">
            <label><?= lang('label_sub_cat') ?> :</label>
            <samp>
                <select name="subcat" id="prodsubcats">
                    <option value="0"><?= lang('label_select_subcat') ?></option>
                </select>
            </samp>
        </div>
        <div class="select">
            <label><?= lang('label_menu_link_trade') ?> :</label>
            <samp>
                <select name="trademark" id="prodtrademark">
                    <option value="0" <?php if (form_val('maincat') == '0') echo 'selected' ?>><?= lang('label_select_trademark') ?></option>
                    <?php
                    if ($trades) {
                        foreach ($trades as $trade) {
                            ?>
                            <option value="<?= $trade->id ?>" <?php if (form_val('maincat') == $trade->id) echo 'selected' ?>><?= $trade->title ?></option>
                            <?php
                        }
                    }
                    ?>
<!--<option value="other"><?= lang('label_select_other') ?></option> -->
                </select>
            </samp>
        </div>

        <div class="text" id="prodothertrade" style="display: none">
            <label for="username"><?= lang('label_other_trademark') ?> :</label>
            <samp>
                <input type="text" name="othertrade" id="othertrade" value="<?= form_val('othertrade') ?>" >
            </samp>
        </div>


        <div class="text">
            <label for="product"><?= lang('label_product_name') ?> :</label>
            <samp>
                <input type="text" name="prodname" id="prodname" value="<?= form_val('prodname') ?>" placeholder="<?= lang('label_product_name') ?>" autocomplete="off" >
            </samp>
        </div>

        <div class="radio">
            <label><?= lang('label_prod_condition') ?> :</label>
            <samp>
                <input name="condition" id="new" value="new" type="radio" checked><label for="new"><?= lang('label_condition_new') ?></label>
                <input name="condition" id="used" value="used" type="radio"><label for="used"><?= lang('label_condition_used') ?></label>
            </samp>
        </div>

        <div class="textarea">
            <label for="proddesc"><?= lang('label_product_desc') ?> :</label>
            <samp>
                <textarea name="descrebtion" id="proddesc" placeholder="<?= lang('label_product_desc') ?>"><?= form_val('descrebtion') ?></textarea>
            </samp>
        </div>
        
        <div id="additional"></div>

        <div class="browse">
            <br />
            <label><?= lang('label_product_images') ?> :</label>

        </div>

        <ul class="uploadedelete">
            <?php for ($i = 1; $i <= $prodimg; $i++) { ?>
                <li>
                    <span>
                        <div class="browse"><samp>
                                <input type="file" name="image<?= $i ?>" id="file<?= $i ?>" value="<?= form_val('email') ?>" /><label for="file<?= $i ?>"></label>

                            </samp><strong></strong></div>
                    </span>
                    <div class="radio">
                        <samp>
                            <input type="radio" name="dimage" value="<?= $i ?>" id="image<?= $i ?>" <?php if ($i == 1) echo 'checked' ?> /><label for="image<?= $i ?>"><?= lang('label_prod_default_image') ?></label>
                        </samp>
                    </div>
                </li>
            <?php } ?>

        </ul>

        <?php if ($prodvedio == 'true') { ?>
            <div class="video text">
                <label for="video"><?= lang('label_product_vedio') ?> :</label>
                <samp>
                    <input type="text" name="video" id="video" value="<?= form_val('video') ?>" placeholder="<?= lang('label_product_vedio_link') ?>" />
                </samp>
            </div>
        <?php } ?>
        <div style="overflow:hidden;">
            <div class="color" id="prodcolor">
                <label for="video"><?= lang('label_product_color') ?> :</label>
                <ul>
                    <li class="color1">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="gray" id="color1" /><label for="color1"></label>
                        </div>
                    </li>
                    <li class="color2">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="white" id="color2" /><label for="color2"></label>
                        </div>
                    </li>
                    <li class="color3">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="black" id="color3" /><label for="color3"></label>
                        </div>
                    </li>
                    <li class="color4">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="red" id="color4" /><label for="color4"></label>
                        </div>
                    </li>
                    <li class="color5">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="blue" id="color5" /><label for="color5"></label>
                        </div>
                    </li>
                    <li class="color6">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="green" id="color6" /><label for="color6"></label>
                        </div>
                    </li>
                    <li class="color7">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="yellow" id="color7" /><label for="color7"></label>
                        </div>
                    </li>
                    <li class="color8">
                        <div class="checkbox">
                            <samp></samp>
                            <input type="checkbox" name="color[]" value="brown" id="color8" /><label for="color8"></label>
                        </div>
                    </li>
                </ul>
            </div>

            <div class="prosize" id="prodsize">
                <label for="video"><?= lang('label_product_size') ?> :</label>
                <ul>
                    <li>
                        <div class="checkbox">
                            <samp>XS</samp>
                            <input type="checkbox" name="size[]" value="xs" id="xs" /><label for="xs"></label>
                        </div>
                    </li>
                    <li>
                        <div class="checkbox">
                            <samp>S</samp>
                            <input type="checkbox" name="size[]" value="s" id="s" /><label for="s"></label>
                        </div>
                    </li>
                    <li>
                        <div class="checkbox">
                            <samp>M</samp>
                            <input type="checkbox" name="size[]" value="m" id="m" /><label for="m"></label>
                        </div>
                    </li>
                    <li>
                        <div class="checkbox">
                            <samp>L</samp>
                            <input type="checkbox" name="size[]" value="l" id="l" /><label for="l"></label>
                        </div>
                    </li>
                    <li>
                        <div class="checkbox">
                            <samp>XL</samp>
                            <input type="checkbox" name="size[]" value="xl" id="xl" /><label for="xl"></label>
                        </div>
                    </li>
                    <li>
                        <div class="checkbox">
                            <samp>2 XL</samp>
                            <input type="checkbox" name="size[]" value="xxl" id="xxl" /><label for="xxl"></label>
                        </div>
                    </li>
                </ul>
            </div>
        </div>


        <div class="money text select">
            <label for="price"><?= lang('label_product_price') ?> :</label>
            <input type="text" name="price" id="price" value="<?= form_val('price') ?>" placeholder="<?= lang('label_product_price') ?>" />

            <label for="discountprec"><?= lang('label_product_disc_prec') ?> :</label>
            <input type="text" name="discount_prec" id="discountprec" value="<?= form_val('discount_prec') ?>" placeholder="%" style="width:40px !important; text-align:center;" />

            <label for="discountprice"><?= lang('label_product_disc_price') ?> :</label>
            <input type="text" name="discount_price" id="discountprice" placeholder="<?= lang('label_product_disc_price') ?>" value="<?= form_val('discount_price') ?>" />

            <label for="quentity"><?= lang('label_product_quentity') ?> :</label>
            <input type="number"  value="<?= form_val('discount_prec') ?>" name="quentity" id="quentity" placeholder="<?= lang('label_product_quentity') ?>" />
        </div>

        <div class="money text select">
            <label for="shipingweghit"><?= lang('label_product_shiping_weghit') ?> :</label>
            <input type="text" style="width: 63px !important" name="shipingweghit" id="shipingweghit" value="<?= (form_val('shipingweghit')) ? form_val('shipingweghit') : '0' ?>" placeholder="<?= lang('label_product_shiping_weghit') ?>" />


            <label for="shipingprice"><?= lang('label_product_shiping_price') ?> :</label>
            <input type="text" style="width: 63px !important" name="shipingprice" id="shipingprice" readonly="" value="<?= form_val('shipingprice') ?>" placeholder="<?= lang('label_product_shiping_price') ?>" />

            <label for="shipingon"><?= lang('label_product_shiping_on') ?> :</label>
            <samp style="width: 135px !important">
                <select name="shipingon" id="shipingon" style="width: 135px !important">
                    <option value="dealer"><?= lang('label_product_shiping_on_dealer') ?></option>
                    <option value="buyer"><?= lang('label_product_shiping_on_buyer') ?></option>
                    <option value="between"><?= lang('label_product_shiping_on_between') ?></option>
                </select>
            </samp>
        </div>
        
        <div class="money text select">
            <label for="shipingunsupport"><?= lang('label_product_shiping_unsupport') ?> :</label>
            <input type="text" style="width: 63px !important" name="shipingunsupport" id="shipingunsupport" value="<?= form_val('shipingunsupport') ?>" placeholder="<?= lang('label_product_shiping_unsupport') ?>" />

        </div>

        <div class="money soffers text textarea">
            <label style="text-align:center;"><?= lang('label_returns_policy') ?> :</label>
            <div class="checkbox" style="display:inline-block; *display:inline; zoom:1; padding:0 !important;">
                <input type="checkbox" name="returnspolicy" id="returnspolicy" /><label for="returnspolicy"></label>
            </div>
            <label for="returnsdays"><?= lang('label_returns_days') ?> :</label>
            <input type="number" name="returnsdays" id="returnsdays" value="<?= form_val('returnsdays') ?>" placeholder="<?= lang('label_day') ?>" style="width:40px !important; text-align:center;" />&nbsp;<strong><?= lang('label_day') ?></strong>

            <label for="returnsnote"><?= lang('label_note') ?> :</label>
            <textarea name="returnsnote" id="returnsnote" placeholder="<?= lang('label_note') ?>" style="width: 225px ! important; height: 45px;"><?= form_val('returnsnote') ?></textarea>
        </div>



        <div class="soffers text">
            <label style="text-align:center;"><?= lang('label_product_special') ?> :</label>
            <div class="checkbox" style="display:inline-block; *display:inline; zoom:1; padding:0 !important;">
                <input type="checkbox" name="special_product" id="soffers" /><label for="soffers"></label><strong>{ <?= (double) get_option('special_product_price') . ' ' . lang('label_sar_day') ?> }</strong>
            </div>


            <label for="spdays" style="text-align:center; width:100px;"><?= lang('label_product_special_days') ?> :</label>
            <input type="number"  value="<?= form_val('special_days') ?>" name="special_days" id="spdays" style="width:60px !important;" />

            <label for="spprice" style="text-align:center; width:125px;"><?= lang('label_product_special_price') ?> :</label>
            <input type="text" name="spprice" id="spprice" readonly="" value="<?= (form_val('spprice')) ? form_val('spprice') : '0' ?>" style="width:100px !important;" />
        </div>


        <input type="hidden" name="store" value="<?= $storeid ?>">
        <div class="submit">
            <input name="submit" value="<?= lang('label_add') ?>" type="submit"  />
        </div>

    </form>
</div>
<input type="hidden" id="shiping_under_ten" value="<?= get_shiping_price() ?>">
<input type="hidden" id="shiping_for_unit" value="<?= get_shiping_price_for_unit() ?>">
<input type="hidden" id="special_product_price" value="<?= get_option('special_product_price') ?>">
